package com.tj.bo.account.server.dao.impl;

import com.fqgj.common.base.AbstractBaseMapper;
import com.fqgj.common.datasource.DataSource;
import com.tj.bo.account.server.dao.AccountExternalDao;
import com.tj.bo.account.server.entity.AccountExternalEntity;
import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.Map;

/**
 * User: account
 * Date: 2020-06-10
 * Time: 14:41:49.642
 */

@Repository
public class AccountExternalDaoImpl extends AbstractBaseMapper<AccountExternalEntity> implements AccountExternalDao {
    @Override
    public AccountExternalEntity selectExternalAccount(String userCode) {
        Map<String, Object> params = new HashMap<>();
        params.put("userCode", userCode);
        return getSqlSession().selectOne(getStatement("selectExternalAccount"), params);
    }

    @Override
    public int deleteAccountExternalByUserCode(String userCode) {
        Map<String, Object> params = new HashMap<>();
        params.put("userCode", userCode);
        return getSqlSession().update(getStatement("deleteAccountExternalByUserCode"), params);
    }
}